package runtime;

import com.google.gson.Gson;

import data.exceptions.Dynamo_DB_Functions_Exception;
import data.objects.PubEntry;
import data.objects.PubThread;
import data.objects.Tenant;
import data.objects.User;

public class Test_Tenant_und_User {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Gson gson = new Gson();
		try {
//			Tenant.create("0","KIT");
//			Tenant t1=Tenant.create("0","TMU");
//			Tenant.update("0",t1.getID(),"TMU");
//			System.out.println(gson.toJson(Tenant.read("0",t1.getID())));
//			System.out.println(gson.toJson(Tenant.read("0")));
//			System.out.println(gson.toJson(Tenant.getMetadata()));
//			System.out.println(gson.toJson(PubEntry.read("0")));
//			System.out.println(gson.toJson(PubThread.read("0")));
//			PubTenant.delete("0","12d371dd-0877-4722-9ed4-00c42ed410ee");
			
			User u1=User.create("0","Alexander","Sigmund");
			User.create("0","Johannes","Baldinger");
			User.create("1","Markus","Schienle");
			User.create("1","Robin","Hofmann");						
//			User.update("0",u1.getID(),"Alexander","S");
			System.out.println(gson.toJson(User.read("0")));
			User.update("0",u1.getID(),"Alexander","Sigmund");			
//			System.out.println(gson.toJson(User.read("0","56bb7cd4-852e-4ee6-987d-76352a7be12a")));
			System.out.println(gson.toJson(User.getMetadata()));
			
			User u2=User.create("0","AAAAAAA","BBBBB");
			System.out.println(gson.toJson(User.read("0")));
			User.delete("0",u2.getID());
			System.out.println(gson.toJson(User.read("0")));
			
			
			
		} catch (Dynamo_DB_Functions_Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		

	}

}
